<style type="text/css">
    .flex{
        height: 40px;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">店铺名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-shop_name" class="form-control" data-rule="required" name="row[shop_name]" type="text" value="" data-role="autocomplete" data-autocomplete-options='{"url":"shops/shop/autocomplete","onCache":true}'>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商家号码:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-phone" class="form-control" name="row[phone]" type="text" value="" data-rule="required">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">平台选择:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-shop_type" data-rule="required" class="form-control selectpicker" name="row[shop_type]">
                {foreach name="shopTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address1" class="form-control" name="row[address]" type="text">
            <input id="c-address" class="form-control" type="hidden">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">店铺销量:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sales_volume" class="form-control" name="row[sales_volume]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商家评分:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-score" class="form-control" name="row[score]" type="text" value="">
        </div>
    </div>
    <input type="hidden" name="row[type]" id="c-type" value="0">
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" id="submit1" class="btn btn-primary btn-embossed disabled">确定</button>
            <button type="submit" id="submit2" class="btn btn-success btn-embossed disabled">保存并跟进</button>
            <!-- <a href="shops/shop/add2"  class="btn btn-default btn-dialog" title="跟进" id="track" > 跟进</a> -->
        </div>
    </div>
</form>

<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
<script>
    window.onload = function(){
        var submit1 = document.getElementById("submit1");
        var submit2 = document.getElementById("submit2");
        var form = document.getElementById("add-form");
        var type = document.getElementById("c-type");
        if (submit1!=undefined) {
            submit1.onclick = function(){
                type.value=1
                // form.submit();Layer.closeAll('dialog');
            }
        }
        if (submit2!=undefined) {
            submit2.onclick = function(){
                type.value=0
                // form.submit();Layer.closeAll('dialog');
            }
        }
    }
</script>
